/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.munchkinquest.model;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author stephen
 */
@Entity
@Table(name = "STEPBTN", catalog = "", schema = "APP")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Stepbtn.findAll", query = "SELECT s FROM Stepbtn s"),
    @NamedQuery(name = "Stepbtn.findById", query = "SELECT s FROM Stepbtn s WHERE s.id = :id"),
    @NamedQuery(name = "Stepbtn.findByStepid", query = "SELECT s FROM Stepbtn s WHERE s.stepid = :stepid order by s.listorder"),
    @NamedQuery(name = "Stepbtn.findByBtnid", query = "SELECT s FROM Stepbtn s WHERE s.btnid = :btnid"),
    @NamedQuery(name = "Stepbtn.findByNextstepid", query = "SELECT s FROM Stepbtn s WHERE s.nextstepid = :nextstepid"),
    @NamedQuery(name = "Stepbtn.findByMethodid", query = "SELECT s FROM Stepbtn s WHERE s.methodid = :methodid"),
    @NamedQuery(name = "Stepbtn.findByListorder", query = "SELECT s FROM Stepbtn s WHERE s.listorder = :listorder")})
public class Stepbtn implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "ID")
    private Long id;
    @Basic(optional = false)
    @NotNull
    @Column(name = "STEPID")
    private long stepid;
    @Basic(optional = false)
    @NotNull
    @Column(name = "BTNID")
    private long btnid;
    @Basic(optional = false)
    @NotNull
    @Column(name = "NEXTSTEPID")
    private long nextstepid;
    @Column(name = "METHODID")
    private Long methodid;
    @Column(name = "LISTORDER")
    private Long listorder;

    @Transient
    private String btnText;

    public String getBtnText() {
        return btnText;
    }

    public void setBtnText(String btnText) {
        this.btnText = btnText;
    }
    
    @Transient
    protected String methodName;

    public String getMethodName() {
        return methodName;
    }

    public void setMethodName(String methodName) {
        this.methodName = methodName;
    }
    
    public Stepbtn() {
    }

    public Stepbtn(Long id) {
        this.id = id;
    }

    public Stepbtn(Long id, long stepid, long btnid, long nextstepid) {
        this.id = id;
        this.stepid = stepid;
        this.btnid = btnid;
        this.nextstepid = nextstepid;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public long getStepid() {
        return stepid;
    }

    public void setStepid(long stepid) {
        this.stepid = stepid;
    }

    public long getBtnid() {
        return btnid;
    }

    public void setBtnid(long btnid) {
        this.btnid = btnid;
    }

    public long getNextstepid() {
        return nextstepid;
    }

    public void setNextstepid(long nextstepid) {
        this.nextstepid = nextstepid;
    }

    public Long getMethodid() {
        return methodid;
    }

    public void setMethodid(Long methodid) {
        this.methodid = methodid;
    }

    public Long getListorder() {
        return listorder;
    }

    public void setListorder(Long listorder) {
        this.listorder = listorder;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Stepbtn)) {
            return false;
        }
        Stepbtn other = (Stepbtn) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.munchkinquest.model.Stepbtn[ id=" + id + " ]";
    }
    
}
